import type { MenuTreeModel } from './sysMenu'

export type RoleModel = {
  createdBy: number // 创建人
  createdTime: string // 创建时间
  delFlag: 0 | 1 // 是否删除 0否 1是
  describe: string // 描述
  id: number // ID
  menuIdList: number[] // 菜单id
  menuNodeList: MenuTreeModel[] // ?
  roleName: string // 角色名称
  roleStatus: 0 | 1 // 状态 1：正常，0：禁用
  roleTypeId: number // 角色类型,关联字典id
  roleTypeName: string // 角色类型名称
  sortIndex: number // 序号
  updatedBy: number // 更新人
  updatedTime: string // 更新时间
  stagingFlag: boolean //是否是公益人员
}

const api: ApiConfig = {
  list: {
    url: '/sys/role/list',
    method: 'GET'
  },
  bindingList: {
    url: '/sys/role/userRolelist',
    method: 'GET'
  },
  select: {
    url: '/sys/role/select',
    method: 'GET'
  },
  selectFilter: {
    url: '/sys/role/selectNormal',
    method: 'GET'
  },
  bind: {
    url: '/sys/role/selectUserByRoleId',
    method: 'GET'
  },
  unbind: {
    url: '/sys/role/unbindUserRole',
    method: 'POST'
  },
  info: {
    url: '/sys/role/info/:id',
    method: 'GET'
  },
  saveRoleMenu: {
    url: '/sys/role/saveRoleMenu',
    method: 'POST'
  },
  save: {
    url: '/sys/role/save',
    method: 'POST'
  },
  delete: {
    url: '/sys/role/delete',
    method: 'POST'
  },
  update: {
    url: '/sys/role/update',
    method: 'POST'
  },
  downItem: {
    url: '/sys/role/moveDown',
    method: 'GET'
  },
  upItem: {
    url: '/sys/role/moveUp',
    method: 'GET'
  },
  topItem: {
    url: '/sys/role/moveToTop',
    method: 'GET'
  },
}

export default api
